<style>
    .tab-content .tab-panel {
        display: none;
    }
    .tab-content .active {
        display: block;
    }
</style>
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <ul class="nav nav-tabs">
        <li class="active"><a href="#info_nav" data-toggle="tab" aria-expanded="true">基本信息</a></li>
        <li class=""><a href="#shop_nav" data-toggle="tab" aria-expanded="true">关联门店</a></li>
        <li class=""><a href="#desc_nav" data-toggle="tab" aria-expanded="false">图文详情</a></li>
    </ul>
    <div style="height: 20px;width:100%;"></div>
    <div class="tab-content">
        <div class="tab-panel" id="shop_nav">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">服务方式:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="radio">
                    {foreach name="shopInList" item="vo"}
                    <label for="row[shop_in]-{$key}"><input id="row[shop_in]-{$key}" name="row[shop_in]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label> 
                    {/foreach}
                    </div>
                </div>
            </div>
            <div class="form-group"  data-favisible="shop_in!=1">
                <label class="control-label col-xs-12 col-sm-2">可服务的门店:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="radio">
                    {foreach name="shopWayList" item="vo"}
                    <label for="row[shop_way]-{$key}"><input id="row[shop_way]-{$key}" name="row[shop_way]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label> 
                    {/foreach}
                    </div>
                </div>
            </div>
            <div class="form-group" data-favisible="shop_in!=1&&shop_way==1">
                <label class="control-label col-xs-12 col-sm-2"></label>
                <div class="col-xs-12 col-sm-10">
                    <dl  class="fieldlist" data-name="row[shop_list]" data-template="tpl_shop">
                        <dd class="form-inline header-box-title">
                            <ins style="width:440px">门店</ins>
                        </dd>
                        <dd class="form-inline"><a href="javascript:;" id="btn_add_row_shop" data-urlpop="deerhome/shop/index?multiple=true" data-title="选择门店" class="btn btn-sm btn-success"><i class="fa fa-plus"></i> 添加</a></dd>
                    </dl>
                    <textarea name="row[shop_list]" class="form-control hide" cols="30" rows="5">[]</textarea>
                    <!--定义模板，模板语法使用Art-Template模板语法-->
                    <script type="text/html" id="tpl_shop">
                        <dd class="form-inline">
                            <input type="hidden" name="row[<%=name%>][<%=index%>][id]" class="form-control" value="<%=row['id']%>" size="30"/>
                            <input type="text" readonly style="width:440px" name="row[<%=name%>][<%=index%>][name]" class="form-control" value="<%=row['name']%>" size="30"/>
                            <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-trash-o"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                        </dd>
                    </script>
                </div>
            </div>
        </div>
        <!-- /shop_nav -->
        <div class="tab-panel active" id="info_nav">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">*{:__('Cate_id')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-cate_id" data-pagination="true" data-page-size="10" data-rule="required" data-params='{"custom[cate_id]":"0"}' data-source="deerhome/cate/selectpage2" class="form-control selectpage" name="row[cate_id]" type="text" value="" placeholder="产品仅支持放在二级类目下面">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">*{:__('Name')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="radio">
                    {foreach name="statusList" item="vo"}
                    <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label> 
                    {/foreach}
                    </div>
        
                </div>
            </div>
    
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">*服务规格:</label>
                <div class="col-xs-12 col-sm-10">
                    <dl  class="fieldlist" data-name="row[gg]" data-template="tpl_gg">
                        <dd class="form-inline header-box-title">
                            <ins style="width:240px">名称</ins>
                            <ins style="width:150px">金额</ins>
                            <ins style="width:100px">单位/时长</ins>
                        </dd>
                        <dd class="form-inline"><a href="javascript:;" id="btn_add_row_gg" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> 添加一行</a></dd>
                    </dl>
                    <textarea name="row[gg]" class="form-control hide" cols="30" rows="5">[{"name":"默认","price":"","dw":"次"}]</textarea>
                    <!--定义模板，模板语法使用Art-Template模板语法-->
                    <script type="text/html" id="tpl_gg">
                        <dd class="form-inline">
                            <input type="text" style="width:240px" name="row[<%=name%>][<%=index%>][name]" class="form-control" value="<%=row['name']%>" size="30"/>
                            <div class="input-group">
                                <input type="number"  style="width:110px" name="row[<%=name%>][<%=index%>][price]" step="0.01" class="form-control" value="<%=row['name']%>" size="30"/><span class="input-group-addon">元</span>
                            </div>
                            <input type="text"  style="width:100px" name="row[<%=name%>][<%=index%>][dw]" class="form-control" value="次" size="10"/>
                            <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-trash-o"></i></span> <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                        </dd>
                    </script>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">*{:__('Worker_fc_bl')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="input-group" style="width: 130px;">
                        <input id="c-worker_fc_bl" data-rule="required" class="form-control" name="row[worker_fc_bl]" type="text" value="">
                        <span class="input-group-addon">%</span>
                    </div>
                    <div style="font-size: 13px;color:#888;">*给服务人员的分成，比如金额100元，分成70%，表示分出去70元</div>
                </div>
            </div>

            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">参与分销:</label>
                <div class="col-xs-12 col-sm-8">
                    
                    <div class="radio">
                    {foreach name="agentList" item="vo"}
                    <label for="row[anget]-{$key}"><input id="row[anget]-{$key}" name="row[anget]" type="radio" value="{$key}" {in name="key" value="2"}checked{/in} /> {$vo}</label> 
                    {/foreach}
                    </div>

                </div>
            </div>
            <div class="form-group" data-favisible="anget=1">
                <label class="control-label col-xs-12 col-sm-2">上级返佣:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="input-group"  style="width: 130px;">
                        <input id="c-anget_lev1" data-rule="required" class="form-control" name="row[anget_lev1]" type="number" value="0">
                        <span class="input-group-addon">%</span>
                    </div>
                    <div style="font-size: 13px;color:#888;">*给消费者上级的返佣，比如金额100元，返佣10%，表示分出去10元</div>
                </div>
            </div>
            <div class="form-group" data-favisible="anget=1">
                <label class="control-label col-xs-12 col-sm-2">上上级返佣:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="input-group " style="width: 130px;">
                        <input id="c-anget_lev2" data-rule="required" class="form-control" name="row[anget_lev2]" type="number" value="0">
                        <span class="input-group-addon">%</span>
                    </div>
                    <div style="font-size: 13px;color:#888;">*给消费者上上级的返佣，比如金额100元，返佣5%，表示分出去5元</div>
                </div>
            </div>

            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">图片集:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="input-group">
                        <input id="c-img_images" class="form-control" size="50" name="row[img_images]" type="text">
                        <div class="input-group-addon no-border no-padding">
                            <span><button type="button" data-params='{"category":"item"}' id="faupload-img_images" class="btn btn-danger faupload" data-input-id="c-img_images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-img_images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                            <span><button type="button" id="fachoose-img_images" class="btn btn-primary fachoose" data-input-id="c-img_images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                        </div>
                        <span class="msg-box n-right" for="c-img_images"></span>
                    </div>
                    <div style="font-size: 13px;color:#888;">*第一张图将被选为封面图</div>
                    <ul class="row list-inline faupload-preview" id="p-img_images"></ul>
                </div>
            </div>
            <!-- <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Video_file')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="input-group">
                        <input id="c-video_file" class="form-control" size="50" name="row[video_file]" type="text">
                        <div class="input-group-addon no-border no-padding">
                            <span><button type="button" id="faupload-video_file" class="btn btn-danger faupload" data-input-id="c-video_file" data-multiple="false" data-preview-id="p-video_file"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                            <span><button type="button" id="fachoose-video_file" class="btn btn-primary fachoose" data-input-id="c-video_file" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                        </div>
                        <span class="msg-box n-right" for="c-video_file"></span>
                    </div>
                    <ul class="row list-inline faupload-preview" id="p-video_file"></ul>
                </div>
            </div> -->
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">基础销量:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-fake_sale_times" class="form-control" name="row[fake_sale_times]" type="number" value="">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input id="c-weigh" class="form-control" name="row[weigh]" type="number">
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-2">{:__('Note')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <textarea id="c-note" class="form-control " rows="5" name="row[note]" cols="50"></textarea>
                </div>
            </div>
        </div>
        <!-- /info_nav -->
        <div class="tab-panel" id="desc_nav">
            <div class="form-group">
                <div class="col-xs-24 col-sm-12">
                    <textarea  id="c-body_con" class="form-control editor"  style="height: 600px;width:500px;"   rows="65" name="row[body_con]" cols="50"></textarea>
                </div>
            </div>
        </div>
        <!-- /desc_nav -->
    </div>
    
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<style>
    .input-group > .msg-box.n-right{
        left: 130px;
    }
    .fieldlist{
        width: 600px;
        background:#f9f9f9;
    }
    .fieldlist .form-inline.header-box-title ins{
        background-color: #f6f1ff !important;
        padding:5px;
    }
    .fieldlist .form-inline.header-box-title {
        background-color: #f6f1ff !important;
    }
    .fieldlist .form-inline {
        padding:0 5px;
    }
    .fieldlist .form-inline:nth-child(odd){
        background-color: #f6f1ff;
        padding:5px;
    }
</style>